package com.weimob.mcloud.wechatwork.customer.service.user.enums;

/**
 * @author junlong.lv
 * @version 1.0
 * @date 2021/11/30 4:38 下午
 */
public enum MsgTypeEnums {

    WX_GZH(0, "WX_GZH", "公众号模板消息"),
    WX_XCX(1, "WX_XCX", "小程序订阅消息"),
    SMS_C(2, "C_SMS", "C端短信消息"),
    PC(3, "PC", "PC消息"),
    APP(4, "APP", "APP消息"),
    SMS_B(5, "B_SMS", "B端短信消息"),
    QYWX(6, "QYWX", "企业微信消息"),
    MAIL(7, "MAIL", "邮箱消息");

    private Integer msgType;
    private String channelCode;
    private String desc;

    private MsgTypeEnums(Integer msgType, String channelCode, String desc) {
        this.msgType = msgType;
        this.channelCode = channelCode;
        this.desc = desc;
    }

    public Integer getMsgType() {
        return this.msgType;
    }

    public String getDesc() {
        return this.desc;
    }

    public String getChannelCode() {
        return this.channelCode;
    }

    public static String getChannelCodeByType(Integer type) {
        MsgTypeEnums[] var1 = values();
        int var2 = var1.length;

        for(int var3 = 0; var3 < var2; ++var3) {
            MsgTypeEnums typeEnums = var1[var3];
            if (typeEnums.getMsgType().equals(type)) {
                return typeEnums.getChannelCode();
            }
        }

        return null;
    }

    public static MsgTypeEnums getMsgTypeEnumByType(Integer type) {
        MsgTypeEnums[] var1 = values();
        int var2 = var1.length;

        for(int var3 = 0; var3 < var2; ++var3) {
            MsgTypeEnums typeEnums = var1[var3];
            if (typeEnums.getMsgType().equals(type)) {
                return typeEnums;
            }
        }

        return null;
    }

    public static MsgTypeEnums getMsgTypeEnumByChannelCode(String channelCode) {
        MsgTypeEnums[] var1 = values();
        int var2 = var1.length;

        for(int var3 = 0; var3 < var2; ++var3) {
            MsgTypeEnums typeEnums = var1[var3];
            if (typeEnums.getChannelCode().equals(channelCode)) {
                return typeEnums;
            }
        }

        return null;
    }

    public static Integer getTypeByChannelCode(String channelCode) {
        MsgTypeEnums[] var1 = values();
        int var2 = var1.length;

        for(int var3 = 0; var3 < var2; ++var3) {
            MsgTypeEnums typeEnums = var1[var3];
            if (typeEnums.getChannelCode().equals(channelCode)) {
                return typeEnums.getMsgType();
            }
        }

        return null;
    }
}
